package com.osce.common.core.entity.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.osce.common.annotation.Excel;
import com.osce.common.core.entity.BaseEntity;
import com.osce.common.core.entity.dto.resp.SysDeptResp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.ArrayList;
import java.util.List;

/**
 * 科室表 sys_dept
 *
 * @author ruoyi
 */
@ApiModel(value = "SysDept", description = "科室实体")
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class SysDept extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 科室ID
     */
    @ApiModelProperty("科室ID")
    @TableId(type = IdType.AUTO)
    private Long deptId;

    /**
     * 父科室ID
     */
    @ApiModelProperty("父科室ID")
    private Long parentId;

    /**
     * 祖级列表
     */
    @ApiModelProperty("祖级列表")
    private String ancestors;

    /**
     * 科室名称
     */
    @ApiModelProperty("科室名称")
    @NotBlank(message = "科室名称不能为空")
    @Size(min = 0, max = 35, message = "科室名称长度不能超过35个字符")
    private String deptName;

    @ApiModelProperty("备注")
    private String remark;

    /**
     * 显示顺序
     */
    @ApiModelProperty("显示顺序")
    @NotNull(message = "显示顺序不能为空")
    private Integer orderNum;

    /**
     * 负责人
     */
    /**
     * 最小容量
     */
    @Excel(name = "最小容量")
    @ApiModelProperty("最小容量")
    private Integer minCapacity;

    /**
     * 最大容量
     */
    @Excel(name = "最大容量")
    @ApiModelProperty("最大容量")
    private Integer maxCapacity;

    /**
     * 上课地点
     */
    @Excel(name = "上课地点")
    @ApiModelProperty("上课地点")
    private String classPlace;

    /**
     * 科室状态:0正常,1停用
     */
    @ApiModelProperty("科室状态:0正常,1停用")
    private Integer status;

    /**
     * 类型
     */
    @ApiModelProperty("类型")
    private Integer type;

    /**
     * 父科室名称
     */
    @ApiModelProperty("父科室名称")
    private String parentName;

    /**
     * 子科室
     */
    private List<SysDeptResp> children = new ArrayList<>();
}
